package io.kqoa.modules.kq.entity.enums;

import lombok.Data;

/**
 * 日历考勤对应的格子
 */

public enum  CalendarAttendanceEunm {


    MONDAY("星期一", 1),

    TUESDAY("星期二", 2),

    WEDNESDAY("星期三", 3),


    THURSDAY("星期四", 4),

    FRIDAY("星期五", 5),

    SATURDAY("星期六", 6),

    SUNDAY("星期日", 0);
    private String week;
    private Integer weekcode;

    CalendarAttendanceEunm(String week, Integer weekcode) {
        this.week = week;
        this.weekcode = weekcode;
    }

    public String getWeek() {
        return week;
    }

    public void setWeek(String week) {
        this.week = week;
    }

    public Integer getWeekcode() {
        return weekcode;
    }

    public void setWeekcode(Integer weekcode) {
        this.weekcode = weekcode;
    }

    /**
     * 根据周几获取应该空几格
     *
     * @param week
     * @return
     */

    public static int queryCalendarAttendanceEunm(String week) {
      if(week.equals("星期一")|| week.equals("Mon")){
          return 1;
      }
      if (week.equals("星期二") || week.equals("Tue")){
          return 2;
      }
      if (week.equals("星期三") || week.equals("Wed")){
         return 3;
      }
      if (week.equals("星期四") || week.equals("Thu")) {
          return 4;
      }
      if (week.equals("星期五") || week.equals("Fri")){
          return 5;
      }
      if (week.equals("星期六") || week.equals("Sat")){
          return 6;
      }
      if (week.equals("星期日") || week.equals("Sun")){
          return 0;
      }
      return 0;
    }
}

